package com.springboot.controller;

import com.springboot.common.annotation.SQLDate;
import com.springboot.entity.UserEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class IndexController {

    @RequestMapping("/index")
    public String index(UserEntity entity, HttpServletRequest request){
        System.out.println("------------index-------------"+entity);
        request.setAttribute("username", entity.getUsername());
        return "index";
    }
}
